package com.neusoft.a312cxy.android18cxy.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.neusoft.a312cxy.android18cxy.R;

/**
 * Created by Young on 2017/11/13.
 */

public class MyOrderinfoActivity extends AppCompatActivity {
    /**
     * id : 300000401
     * type : 2
     * signid : 3
     * update_time : 2017-10-30 21:34:49
     * pay : 330
     * price : 120
     * name : 线下训练（入门）
     * thumb : train/thumb/20161202/thumb_20161202103554_1934088441.jpg
     * userid : 19
     * vstate : 0
     */

    private String id,type,update_time,price,name;
    private TextView id1,type1,price1,name1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_orderinfo);

        intview();
        saveDate();
        // getuserinfo;
    }

public void saveDate(){
    Intent intent = getIntent();
    Bundle bundle=intent.getExtras();

    id1.setText(intent.getStringExtra("orderid"));
    //    sex.setText(intent.getStringExtra("sex"));
    price1.setText(intent.getStringExtra("price"));
    name1.setText(intent.getStringExtra("name"));
    type=bundle.getString("type");
    //订单类型
    if(type.equals("1")){
        type1.setText("活动订单");
    }
    else if(type.equals("2")){
        type1.setText("培训订单");
    }
    else if (type.equals("3")){
        type1.setText("课程订单");
    }

}

    public void intview(){
        id1=(TextView) findViewById(R.id.id1);
        price1=(TextView) findViewById(R.id.price1);
        name1=(TextView) findViewById(R.id.name1);
        type1=(TextView) findViewById(R.id.type1);

    }
}
